Page({
  data: {
    favoriteList: [
      {
        id: 1,
        imageUrl: "https://img.alicdn.com/i2/2214597731659/O1CN01c6NAuk1O7s4BvV998_!!2214597731659-0-scmitem8000.jpg",
        title: "感冒灵",
        // description: "解热镇痛，用于感冒引起的头痛、发热、鼻塞、流涕、咽痛等。",
        price: "￥20.00"
      },
      {
        id: 2,
        imageUrl: "https://picsum.photos/200/200",
        title: "商品标题2",
        // description: "商品描述信息2",
        price: "￥199.00"
      }
    ]
  },
  removeFavorite(e) {
    const id = e.currentTarget.dataset.id;
    const newFavoriteList = this.data.favoriteList.filter(item => item.id!== id);
    this.setData({
      favoriteList: newFavoriteList
    });
  }
})    